import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
import Layout from '@/layout/Layout.vue'
import HomeView from '../views/HomeView.vue'
import OpusVue from '@/views/Opus.vue'
import SkillVue from '@/views/Skill.vue'
import WorkVue from '@/views/Work.vue'
import User from '@/layout/Mobile/components/User.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    redirect: '/homeView',
    component: Layout,
    children: [
      {
        path: '/homeView',
        name: 'home',
        component: HomeView,
        redirect: '/homeView/opus',
        children: [
          {
            path: '/homeView/opus',
            name: 'Opus',
            component: OpusVue
          },
          {
            path: '/homeView/skill',
            name: 'Skill',
            component: SkillVue
          },
          {
            path: '/homeView/work',
            name: 'Work',
            component: WorkVue
          },
          {
            path: '/homeView/user',
            name: 'User',
            component: User
          }
        ]
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: routes
})

export default router
